Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheQuyNganHang
    Private sohieu, tentk As String
    Private thangnam As Date
    Private tungay As Date
    Private denngay As Date
    Private customerReport As ReportDocument

    Private Sub FrmCrTheQuyNganHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT *, tkdoi as tkdoiung FROM tbl_dot_temp_thenganhang order by ngay"
        Dim data As DataTable = moduleReportConfig.GetDataTable(sqlQuery)
        Dim tienDauKy As Double = 0
        Try
            If data.Rows.Item(0).Item(1).ToString = "ZZZZZZZZ" Then
                tienDauKy = data.Rows.Item(0).Item(9)
            End If
        Catch ex As Exception
        End Try

        Dim reportPath = Application.StartupPath & "\" & "crTheQuyNganHang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(data)
        customerReport.SetParameterValue("TThangnam", thangnam)
        customerReport.SetParameterValue("TTungay", tungay)
        customerReport.SetParameterValue("TDenngay", denngay)
        customerReport.SetParameterValue("TSohieu", sohieu)
        customerReport.SetParameterValue("TTentk", tentk)
        customerReport.SetParameterValue("tienDauKy", tienDauKy)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub

    Public Sub setThangnam(ByVal s As Date)
        thangnam = s
    End Sub
    Public Sub setTungay(ByVal s As Date)
        tungay = s
    End Sub
    Public Sub setDenngay(ByVal s As Date)
        denngay = s
    End Sub


    Public Sub setSohieu(ByVal s As String)
        sohieu = s
    End Sub
    Public Sub setTentk(ByVal s As String)
        tentk = s
    End Sub
End Class
